import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
  username: ''
}
const mutations = {
  setusername: (state, value) => {
    state.username = value
    localStorage.setItem('username', value)
  }
}
const actions = {
  setusernameActions: ({ commit }, value) => {
    commit('setusername', value)
  }
}
const getters = {
  username: (state) => {
    return localStorage.getItem('username')
  }
}
export default new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})
